@echo off

set JVM_HOME=..\..
if %JDK_HOME%.==. goto SETHOME

echo ---------------------------
echo Compiling Sort...
echo ---------------------------
%JDK_HOME%\bin\javac -target 1.1 -classpath .;%JVM_HOME%\lib\javax.jar;%JVM_HOME%\lib\lpc2xxx.jar -bootclasspath ;%JVM_HOME%\lib\java.jar *.java
if errorlevel==1 goto ERROR

echo Linking...
set CLASSPATH=%JVM_HOME%\lib\ClassLinker.jar
%JDK_HOME%\bin\java ClassLinker -f Sort
if errorlevel==1 goto ERROR
goto EXIT

:ERROR
echo Build failed
goto EXIT

:SETHOME
echo Missing JDK_HOME environment variable. For example: SET JDK_HOME=C:\JDK1.3

:EXIT
if %SKIP_PAUSE%.==. pause
